﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaiwuModFramework.Common.Abstract;
using TaiwuModFramework.Common.Attribute;
using TaiwuModFramework.Common.Info;
using TaiwuModFramework.Common.Manager;

namespace TaiwuModFramework.Backend.Service {
    public class ConfigItemService : AService {

        public static ALogger Log { get { return FwDomain.Log; } }


        [AttrService("UpdateConfigItem")]
        public static void UpdateConfigItem(string modIdStr,  string key, object value) {
            ConfigManager.UpdateItem(modIdStr, key, value);
        }


        [AttrService("PrintAllItem")]
        public static List<string>  PrintAllItem(string modIdStr) {
            var list = ConfigManager.GetItemKeyByModId(modIdStr);
            foreach(var key in list) {
                Log.Info(key);
            }
            return list;
        }
    }
}
